Optimal. Leaf size=39 \[ \frac{\sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} b}-\frac{x}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.059619, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {3191, 391, 203, 205} \[ \frac{\sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} b}-\frac{x}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3191
Rule 391
Rule 203
Rule 205
Rubi steps
\begin{align*} \int \frac{\cos ^2(x)}{a+b \sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (x)\right )}{b}+\frac{(a+b) \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\tan (x)\right )}{b}\\ &=-\frac{x}{b}+\frac{\sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} b}\\ \end{align*}
Mathematica [A] time = 0.056113, size = 39, normalized size = 1. \[ \frac{\sqrt{a+b} \tan ^{-1}\left (\frac{\sqrt{a+b} \tan (x)}{\sqrt{a}}\right )}{\sqrt{a} b}-\frac{x}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.077, size = 58, normalized size = 1.5 \begin{align*} -{\frac{\arctan \left ( \tan \left ( x \right ) \right ) }{b}}+{\frac{a}{b}\arctan \left ({ \left ( a+b \right ) \tan \left ( x \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}}+{\arctan \left ({ \left ( a+b \right ) \tan \left ( x \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \right ){\frac{1}{\sqrt{a \left ( a+b \right ) }}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.17185, size = 508, normalized size = 13.03 \begin{align*} \left [\frac{\sqrt{-\frac{a + b}{a}} \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - 4 \,{\left ({\left (2 \, a^{2} + a b\right )} \cos \left (x\right )^{3} -{\left (a^{2} + a b\right )} \cos \left (x\right )\right )} \sqrt{-\frac{a + b}{a}} \sin \left (x\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (x\right )^{4} - 2 \,{\left (a b + b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) - 4 \, x}{4 \, b}, -\frac{\sqrt{\frac{a + b}{a}} \arctan \left (\frac{{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a - b\right )} \sqrt{\frac{a + b}{a}}}{2 \,{\left (a + b\right )} \cos \left (x\right ) \sin \left (x\right )}\right ) + 2 \, x}{2 \, b}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12046, size = 84, normalized size = 2.15 \begin{align*} \frac{{\left (\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac{a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )\right )}{\left (a + b\right )}}{\sqrt{a^{2} + a b} b} - \frac{x}{b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]